]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionUtils: Don't write to the filesystem on start
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 25 May 2012 23:12:30 +0000 (19:12 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 12 Jun 2012 21:16:08 +0000 (17:16 -0400)
Create the potentially empty directory when we need to, not when we
don't.

https://bugzilla.gnome.org/show_bug.cgi?id=677586

js/misc/extensionUtils.js
js/ui/extensionDownloader.js

index 77a49d5b535a0b02bc5c6f06e50b29f23b827ed5..24109d57176a3b314ad9e5b25f8321876e49c110 100644 (file)
@@ -158,12 +158,6 @@ function installImporter(extension) {
 function init() {
     let userExtensionsPath = GLib.build_filenamev([global.userdatadir, 'extensions']);
     userExtensionsDir = Gio.file_new_for_path(userExtensionsPath);
-    try {
-        if (!userExtensionsDir.query_exists(null))
-            userExtensionsDir.make_directory_with_parents(null);
-    } catch (e) {
-        logError(e, 'Could not create extensions directory');
-    }
 }
 
 function scanExtensionsInDirectory(callback, dir, type) {
index 507fc2c69c0b1809eb08eae86df304af22ad1ac8..f83100daf1f0d7825742a3d68abf0ce8c7ed3d63 100644 (file)
@@ -66,8 +66,15 @@ function gotExtensionZipFile(session, message, uuid) {
         return;
     }
 
-    let [file, stream] = Gio.File.new_tmp('XXXXXX.shell-extension.zip');
     let dir = ExtensionUtils.userExtensionsDir.get_child(uuid);
+    try {
+        if (!dir.query_exists(null))
+            dir.make_directory_with_parents(null);
+    } catch (e) {
+        logExtensionError('Could not create extension directory');
+    }
+
+    let [file, stream] = Gio.File.new_tmp('XXXXXX.shell-extension.zip');
     let contents = message.response_body.flatten().as_bytes();
     stream.output_stream.write_bytes(contents, null);
     stream.close(null);